﻿@model Monitor.Models.LoginModel
@{
    ViewBag.Title = "Выполнить вход";
    if (ViewBag.ReturnUrl == "modal"){Layout = null;}
}
@if (!User.Identity.IsAuthenticated){
    <script>
        $(document).ready(function() {
            $('#succes').jqxButton({ theme: theme, height: 30, width: '100%' });
            $("#UserName").jqxInput({ placeHolder: "логин", height: 25, width: '100%', minLength: 1, theme: theme });
            $("#Password").jqxInput({ placeHolder: "пароль", height: 25, width: '100%', minLength: 1, theme: theme });

        });
    </script>
    using (Html.BeginForm(new {ReturnUrl = ViewBag.ReturnUrl}))
    {
        @Html.AntiForgeryToken()
        @Html.ValidationSummary(false)
        <table style="text-align: right">
            @if (string.IsNullOrEmpty(Layout))
            {
                <tr>
                    <td>
                        @Html.TextBoxFor(m => m.UserName)
                        @Html.ValidationMessageFor(m => m.UserName)
                    </td>
                </tr>
                <tr>
                    <td>
                        @Html.PasswordFor(m => m.Password)
                        @Html.ValidationMessageFor(m => m.Password)
                    </td>                           
                </tr>
                <tr>
                    <td>
                        <input id="succes" type="submit" value="Выполнить вход" />
                    </td>
                </tr>
            }else
            {


                <tr>
                    <td>@Html.LabelFor(m => m.UserName)</td>
                    <td>@Html.TextBoxFor(m => m.UserName)</td>
                </tr>
                <tr>
                    <td colspan="2">
                        @Html.ValidationMessageFor(m => m.UserName)
                    </td>
                </tr>

                <tr>
                    <td>@Html.LabelFor(m => m.Password)</td>
                    <td>@Html.PasswordFor(m => m.Password)</td> 
                </tr>
                <tr>
                    <td colspan="2">
                        @Html.ValidationMessageFor(m => m.Password)
                    </td>
                </tr>
                <!--
                    <tr>
                        <td colspan="2" style="text-align: center">
                            Html.CheckBoxFor(m => m.RememberMe)
                            Html.LabelFor(m => m.RememberMe)
                        </td>
                    </tr>-->
                <tr>
                    <td colspan="2" style="text-align: center">
                        <input id="succes" type="submit" value="Выполнить вход" />
                    </td>
                </tr>
            }
        </table>
    }
}
